import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { PayAlipayOrdersSignForm, PayAlipayOrdersSignQuery, PayAlipayOrdersSignVo } from '@/api/pay/model/alipayOrdersSignModel';
import { request } from '@/utils/request';

// 查询支付宝订单信息列表
export function listAlipayOrdersSign(query?: PayAlipayOrdersSignQuery) {
  return request.get<TableDataInfo<PayAlipayOrdersSignVo>>({
    url: '/pay/alipayOrdersSign/list',
    params: query,
  });
}

// 查询支付宝订单信息详细
export function getAlipayOrdersSign(alipayId: string) {
  return request.get<R<PayAlipayOrdersSignVo>>({
    url: `/pay/alipayOrdersSign/${alipayId}`,
  });
}

// 新增支付宝订单信息
export function addAlipayOrdersSign(data: PayAlipayOrdersSignForm) {
  return request.post<R<void>>({
    url: '/pay/alipayOrdersSign',
    data,
  });
}

// 修改支付宝订单信息
export function updateAlipayOrdersSign(data: PayAlipayOrdersSignForm) {
  return request.put<R<void>>({
    url: '/pay/alipayOrdersSign',
    data,
  });
}

// 删除支付宝订单信息
export function delAlipayOrdersSign(alipayIds: string | Array<string>) {
  return request.delete<R<void>>({
    url: `/pay/alipayOrdersSign/${alipayIds}`,
  });
}
